package com.smartbank.startup;

import java.io.IOException;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.smartbank.entity.UserInfo;
import com.smartbank.service.UserInfoService;

public class Consumer {
	private static final Logger LOGGER = LoggerFactory.getLogger(Consumer.class);
	public static void main(String[] args) throws IOException {
		ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
				"classpath:dubbo-consumer.xml");
		context.start();
		
		UserInfoService userService = (UserInfoService)context.getBean("userInfoService", UserInfoService.class);
		UserInfo userInfo = userService.findUserInfoById("110119120");
		LOGGER.info("调用服务成功,userID为：" + userInfo.getId());
		System.in.read(); // 按任意键退出
	    context.close(); 
	}
}
